﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uc_LapYeuCau.ascx.cs"
    Inherits="CSMember_UserControl_uc_LapYeuCau" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css" media="print">
    .jwts_tabbernav
    {
        display: none;
    }
</style>
<script type="text/javascript">    var jwts_slideSpeed = 30; var jwts_timer = 10;</script>
<script type="text/javascript">
    $(function () {
        var objNgay = document.getElementById("<%=txtNgay.ClientID %>");
        $(objNgay).datepicker({
            showOn: "button",
            buttonImage: "../images/calendar.gif",
            buttonImageOnly: true
        });
    });
</script>
<script type="text/javascript">
    xAddEventListener(window, 'load',
            function () { new xTableHeaderFixed('gvTheGrid', 'divSearchList', 0); }, false);

    function OnKey(obj) {        
        var grid = document.getElementById("<%= grdList.ClientID %>");
        var cellISBN;
        if (grid.rows.length > 0) {
            for (i = 1; i < grid.rows.length; i++) {
                cellISBN = grid.rows[i].cells[5];
                if (cellISBN.innerHTML.indexOf(obj.value) < 0)
                    grid.rows[i].setAttribute("style", "display:none;");
                else
                    grid.rows[i].setAttribute("style", "");
            }
        }        
    }
</script>
<div style="height: 850px">
    <div class="TitlePage">
        LẬP YÊU CẦU SOẠN HÀNG</div>
    <%--<asp:UpdatePanel ID="updatepanel1" runat="server">
        <ContentTemplate>
        </ContentTemplate>
        </asp:UpdatePanel>--%>
    <asp:Panel runat="server" ID="Panel1">
        <div style="text-align: left; width: 100%">
            <fieldset>
                <table width="100%">
                    <tr>
                        <td class="tdsearch1">
                        </td>
                        <td align="left" class="tdsearch2">
                            Ngày <span style="color: Red">(*)</span>:
                        </td>
                        <td align="left" class="tdsearch3">
                            <asp:TextBox runat="server" ID="txtNgay" MaxLength="50" CssClass="txtBoxDate" Width="90%"></asp:TextBox>
                        </td>
                        <td class="tdsearch4">
                        </td>
                        <td align="left" class="tdsearch5">
                            Buổi <span style="color: Red">(*)</span>:
                        </td>
                        <td align="left" class="tdsearch6" style="margin-right: 5px">
                            <asp:DropDownList ID="ddlBUOI" CssClass="txtBox" runat="server" Width="100%">
                            </asp:DropDownList>
                        </td>
                        <td class="tdsearch7">
                        </td>
                    </tr>
                    <tr>
                        <td class="tdsearch1">
                        </td>
                        <td align="left" class="tdsearch2">
                            Chọn tuyến <span style="color: Red">(*)</span>:
                        </td>
                        <td align="left" class="tdsearch3">
                            <telerik:RadComboBox ID="ddlRoute" runat="server" Height="140px" Width="100.5%" RenderingMode="Full"
                                CheckBoxes="true" EnableCheckAllItemsCheckBox="true">
                                <Localization AllItemsCheckedString="Đã chọn tất cả" CheckAllString="Chọn tất cả"
                                    ItemsCheckedString=" dòng được chọn" />
                            </telerik:RadComboBox>
                        </td>
                        <td class="tdsearch4">
                        </td>
                        <td align="left" class="tdsearch5">
                            Chọn nhóm KH <span style="color: Red">(*)</span>:
                        </td>
                        <td align="left" class="tdsearch6" style="margin-right: 5px">
                            <telerik:RadComboBox ID="ddlGroupCode" runat="server" Height="140px" Width="100.5%"
                                RenderingMode="Full" CheckBoxes="true" EnableCheckAllItemsCheckBox="true">
                                <Localization AllItemsCheckedString="Đã chọn tất cả" CheckAllString="Chọn tất cả"
                                    ItemsCheckedString=" dòng được chọn" />
                            </telerik:RadComboBox>
                        </td>
                        <td class="tdsearch7">
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="7">
                            <asp:Label ID="lblAlerting" runat="server" CssClass="Alerting"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="7">
                            <asp:Button CssClass="btn_admin" ID="btnSearch" runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click" />
                            &nbsp;&nbsp;
                            <asp:Button ID="btnSave" runat="server" CssClass="btn_admin" Text="Lưu" OnClick="btnSave_Click" />
                            &nbsp;&nbsp;
                            <asp:Button ID="btnRefesh" runat="server" CssClass="btn_admin" Text="Làm mới" OnClick="btnRefesh_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
    </asp:Panel>
    <div style="clear: both; height: 10px">
    </div>
    <div id="divSearchList">
        <asp:GridView ID="grdList" runat="server" AutoGenerateColumns="false"
            CssClass="gvTheGrid" PageSize="10000">
            <Columns>
                <asp:TemplateField HeaderText="Tên tuyến" ControlStyle-Width="80px">
                    <ItemTemplate>
                        <asp:HiddenField ID="hdfROUTEID" runat="server" Value='<%# Eval("RouteID") %>' />
                        <asp:HiddenField ID="hdfKHOID" runat="server" Value='<%# Eval("KhoID") %>' />
                        <asp:Label ID="lblListingRouteName" runat="server" Text='<%# Eval("RouteName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Từ kho" ControlStyle-Width="100px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTenKho" runat="server" Text='<%# Eval("TenKho") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mã KH" ControlStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingMaKhachHang" runat="server" Text='<%# Eval("CardCode") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên khách hàng" ControlStyle-Width="180px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTenKhachHang" runat="server" Text='<%# Eval("CardName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Số SO" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="60px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingSO" runat="server" Text='<%# Eval("SONbr") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ControlStyle-Width="90px">
                    <HeaderTemplate>
                        <asp:TextBox ID="txtISBNNameHeader" runat="server" BorderStyle="None" BackColor="Transparent"
                            CssClass="txtISBNHeader" onkeyup="OnKey(this);" Width="70px"></asp:TextBox>
                        <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtISBNNameHeader"
                            WatermarkText="ISBN">
                        </asp:TextBoxWatermarkExtender>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblListingISBN" runat="server" Text='<%# Eval("ISBN") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên sách" ControlStyle-Width="200px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingBookName" runat="server" Text='<%# Eval("TENSACH") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="Kho" ControlStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="lblListingKhoSach" runat="server" Text='<%# Eval("KHOSACHID") %>'></asp:Label>
                         <asp:HiddenField ID="hdfKHOSACHID" runat="server" Value='<%# Eval("KHOSACHID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Số lượng" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="60px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTSL" runat="server" Text='<%# string.Format("{0:N0}", Eval("OpenQty")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ngày ETD" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingNgayETD" runat="server" Text='<%# Eval("SHIPDATE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Chọn" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="50px">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSave" Width="50px" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SL yêu cầu" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="80px">
                    <ItemTemplate>
                        <asp:TextBox ID="txtSOLUONG" Width="70px" runat="server" Text='<%# string.Format("{0:N0}",Eval("SOLUONGGIAO")) %>'
                            onKeyUp="addCommas(event,this);" CssClass="txtnumber"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tồn kho HCM" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTongTonKho" runat="server" Text='<%# string.Format("{0:N0}",Eval("TONGCONG")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tồn kho Q9" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTongTonKhoQ9" runat="server" Text='<%# string.Format("{0:N0}",Eval("KHOQ9")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Credit Q9" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingCreditQ9" runat="server" Text='<%# string.Format("{0:N0}",Eval("CREDITQ9")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Reserve Q9" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingReverseQ9" runat="server" Text='<%# string.Format("{0:N0}",Eval("RESERVEQ9")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tồn kho Q1" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTongTonKhoQ1" runat="server" Text='<%# string.Format("{0:N0}",Eval("KHOQ1")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tồn kho HN" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingTongTonKhoHN" runat="server" Text='<%# string.Format("{0:N0}",Eval("KHOHN")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Intransit" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingInTransit" runat="server" Text='<%# string.Format("{0:N0}",Eval("INTRANSIT")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="PO Orders" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <asp:Label ID="lblListingPOOrders" runat="server" Text='<%# string.Format("{0:N0}",Eval("POOrder")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerStyle CssClass="pager" HorizontalAlign="Right" />
        </asp:GridView>
    </div>
</div>
<asp:HiddenField ID="hdfDateTime" runat="server" />
